package com.ruoyi.employee.service.impl;

import java.util.List;

import com.ruoyi.employee.domain.Dto.EmployeeDto;
import com.ruoyi.employee.domain.vo.EmployeeStatus;
import com.ruoyi.employee.domain.vo.EmployeeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import com.ruoyi.employee.mapper.EmployeeMapper;
import com.ruoyi.employee.domain.Employee;
import com.ruoyi.employee.service.IEmployeeService;

/**
 * 员工花名册Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-29
 */

@Service("VueEmployeeService")
public class EmployeeServiceImpl implements IEmployeeService 
{
    @Autowired
    @Qualifier("VueEmployeeMapper")
    private EmployeeMapper employeeMapper;

    /**
     * 查询员工花名册
     * 
     * @param id 员工花名册主键
     * @return 员工花名册
     */
    @Override
    public Employee selectEmployeeById(Long id)
    {
        return employeeMapper.selectEmployeeById(id);
    }

    /**
     * 查询员工花名册列表
     * 
     * @param employee 员工花名册
     * @return 员工花名册
     */
    @Override
    public List<EmployeeVo> selectEmployeeList(EmployeeVo employeeVo)
    {
        return employeeMapper.selectEmployeeList(employeeVo);
    }

    /**
     * 新增员工花名册
     * 
     * @param employee 员工花名册
     * @return 结果
     */
    @Override
    public int insertEmployee(Employee employee)
    {
        return employeeMapper.insertEmployee(employee);
    }

    /**
     * 修改员工花名册
     * 
     * @param employee 员工花名册
     * @return 结果
     */
    @Override
    public int updateEmployee(Employee employee)
    {
        return employeeMapper.updateEmployee(employee);
    }

    /**
     * 批量删除员工花名册
     * 
     * @param ids 需要删除的员工花名册主键
     * @return 结果
     */
    @Override
    public int deleteEmployeeByIds(Long[] ids)
    {
        return employeeMapper.deleteEmployeeByIds(ids);
    }

    /**
     * 删除员工花名册信息
     * 
     * @param id 员工花名册主键
     * @return 结果
     */
    @Override
    public int deleteEmployeeById(Long id)
    {
        return employeeMapper.deleteEmployeeById(id);
    }

    /**
     * 获取员工情况，在职，离职，退休，其他
     *
     * @return 员工花名册集合
     */
    @Override
    public EmployeeStatus getEmployeeList() {
       EmployeeStatus dataList =  employeeMapper.getEmployeeList();
        return dataList;
    }

    /**
     * 年龄分布
     *
     * @return
     */
    @Override
    public EmployeeStatus getEmployeeAgeDivisionList() {
        return employeeMapper.getEmployeeAgeDivisionList();
    }

    /**
     * 员工花名册
     * 查看员工详情
     */
    @Override
    public EmployeeDto selectEmployeeDetailsById(Long id) {
        return employeeMapper.selectEmployeeDetailsById(id);
    }
}
